package com.cskaoyan.mapper;

import com.cskaoyan.bean.bo.WxCartUpdateBO;
import com.cskaoyan.bean.pojo.MallCart;
import com.cskaoyan.bean.pojo.MallCartExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface MallCartMapper {
    long countByExample(MallCartExample example);

    int deleteByExample(MallCartExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MallCart record);

    int insertSelective(MallCart record);

    List<MallCart> selectByExample(MallCartExample example);

    MallCart selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MallCart record, @Param("example") MallCartExample example);

    int updateByExample(@Param("record") MallCart record, @Param("example") MallCartExample example);

    int updateByPrimaryKeySelective(MallCart record);

    int updateByPrimaryKey(MallCart record);

    void updateCheckedById(@Param("isChecked") int isChecked, @Param("pid") Integer pid, @Param("id") int id, @Param("date") Date date);

    void updateNumberById(@Param("wxCartUpdateBO") WxCartUpdateBO wxCartUpdateBO, @Param("date") Date date);

    void deleteById(@Param("userId") int userId, @Param("productId") Integer productId, @Param("date") Date date);

    int selectOldNumByUidAndPid(@Param("productId") int productId, @Param("uid") int uid);

    void updateAddNumByUidAndPid(@Param("date") Date date, @Param("needNum") int needNum, @Param("productId") int productId, @Param("uid") int uid);

    Integer selectNumByUidAndPid(@Param("productId") int productId, @Param("uid") int uid);

    int selectCartIdByUidAndPid(@Param("productId") int productId, @Param("uid") int uid);
}